<template>
    <div class="box">
       <label class="user-label" v-if="is_icon">
            <i-icon :type="is_type" color="#999999" size="18" />
        </label>

        <input :type="is_ipt_type" v-model="is_value" @blur="get_val" class="user-content"  :placeholder="is_placeholder" autocomplete="off" :disabled="is_disabled" >

    </div>
</template>

<script>
    import {Icon,Input} from "iview"
    export default {
        name: "ipt",
        data(){
            return{
                is_value:'',
                is_disabled:true,
            }
        },
        props:{
            is_icon:{type:Boolean,default:true},
            is_type:{type:String,default:'md-person'},
            is_placeholder:{type:String,default:""},
            is_ipt_type:{type:String,default:"text"},
            is_name:{type:String,default:""}
        },
        methods:{
            get_val(){
                let data={}
                data.key = this.is_name
                data.value = this.is_value
                this.$emit("get_val",data)
            }
        },
        created(){
            this.is_value = ''
            this.is_disabled =true
        },
        mounted(){
            let _this = this
            let timmer = setTimeout(function(){
                _this.is_disabled =false
                clearTimeout(timmer)
            },1000)

        },
        components:{
            iIcon:Icon,
            iInput:Input
        }
    }
</script>

<style scoped>
    .box{
        width: 100%;
        border: 1px solid #bdbdbd;
        margin-bottom: 20px;
        position: relative;
    }
    .user-label{
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 40px;
        line-height: 40px;
        height: 40px;
        background: #f3f3f3;
        font-size: 18px;
        color: #d3d3d3;
        text-align: center;
        border-right: 1px solid #bdbdbd;
    }
    .user-content{
        padding: 0 0 0 50px;
        width: 308px;
        height: 40px;
        line-height: 40px;
        font-size: 16px;
        color: #333;
        border: none;
        outline: none;
    }
</style>